Skip to main content

All Questions

1vote
1answer
938views

Conditional regex pattern matching in a korn shell script

I have started learning Unix shell scripting using korn shell. Please enlighten me finding the mistake I am doing while writing a ksh code for below a problem as stated below : My script takes 2 ...
Ritesh's user avatar
1vote
1answer
764views

Why does =~ operator give a syntax error on Solaris while comparing with a regular expression

I used this following piece of code appcount_range="^[1-$APP_COUNT]$" until [[ $APP_OPTION =~ $appcount_range ]] do echo "INVALID CHOICE! Please enter a valid option:" ...
Pratik Mayekar's user avatar
2votes
5answers
3kviews

Regular Expression for Mixed cased words

I want a regular expression that will help me identify if a certain pattern is present as a mixed case in a sentence or not. Say: Fox juMPed the rock Now, I want to find that if the pattern jumped ...
haldar55's user avatar
2votes
2answers
2kviews

Regex for phrase matching with case statement in ksh

I am trying to start or stop a service on AIX in ksh. I am trying to start to build in fool proofing for checking things like if the services is already down, etc. Here is my script #!/bin/ksh #####...
Chris Aldrich's user avatar
8votes
5answers
44kviews

Match regex in ksh

I am looking to do something like this in KSH: if (( $var = (foo|bar)[0-9]*$ )); then print "variable matched regex" fi Is it possible at all? For the record I'm using Ksh Version M-11/16/88i on ...
rahmu's user avatar
  • 20.4k
2votes
3answers
1kviews

regexp in ksh for extensions tgz, tar.tgz

I'm trying to get a regexp (in ksh) to identify files with only the following extensions: tgz, tar.gz, TGZ and TAR.GZ. I tried several but can't get them to work. I'm using this regexp to select only ...
user463674's user avatar

close